Skip to content

feat(events): differentiate draft-incomplete vs draft-complete UI for presentations#991

Open
romanetar wants to merge 1 commit into
masterfrom
hotfix/draft-update-tweaks
Open

feat(events): differentiate draft-incomplete vs draft-complete UI for presentations#991
romanetar wants to merge 1 commit into
masterfrom
hotfix/draft-update-tweaks

Conversation

@romanetar

@romanetar romanetar commented Jun 18, 2026

Copy link
Copy Markdown

ref https://app.clickup.com/t/86ba3xg57

Summary by CodeRabbit

  • Bug Fixes
    • Refined event form draft state handling to improve when draft completion warnings appear and adjust availability of save and mark-as-complete options during event editing.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

EventForm gains an isDraftComplete() method that returns true when status === "NonReceived" and progress === "COMPLETE". A new showDraftUI boolean consolidates the draft-gate condition in render(). Draft missing-field warnings, the primary button label, and the "save as incomplete" button are now all gated on showDraftUI && !isDraftComplete().

Changes

EventForm Draft-Complete State Refactor

Layer / File(s) Summary
isDraftComplete() and getMissingDraftFields() methods
src/components/forms/event-form.js
Adds isDraftComplete() (true when status === "NonReceived" and progress === "COMPLETE"). Strips date/duration and disclaimer-acceptance checks from getMissingDraftFields(), leaving only core field validation.
showDraftUI flag and render gating
src/components/forms/event-form.js
Introduces showDraftUI = isPresentation() && !isNew() && !isComplete() in render(). missingDraftFields is now computed only when showDraftUI && !isDraftComplete(), narrowing when the missing-fields warning appears.
Submit button label and save-as-incomplete visibility
src/components/forms/event-form.js
Primary button switches to save_and_mark_complete label and the "save as incomplete" button renders only under showDraftUI && !isDraftComplete(), replacing the prior isPresentation()/isNew()/isComplete() checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fntechgit/summit-admin#982: Modifies the same event-form.js draft/banner visibility logic using isComplete() gating, directly related to the isDraftComplete() distinction introduced here.
  • fntechgit/summit-admin#986: Also changes event-form.js draft-warning and "save as incomplete" button conditions for presentation events, overlapping with the showDraftUI refactor here.

Suggested reviewers

  • smarcet

Poem

🐰 A draft once lost in tangled code,
Now isDraftComplete() lights the road.
showDraftUI guards the warning clear,
No stray save-as-incomplete to fear.
The bunny hops with buttons true —
Each label shown for the right view! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding UI differentiation for presentation drafts based on incomplete vs. complete states.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/draft-update-tweaks

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/forms/event-form.js`:
- Around line 750-753: The isDraftComplete() method uses hardcoded string
literals "NonReceived" and "COMPLETE" instead of constants, which can lead to
typos and maintenance issues. Create two new constant definitions in
src/utils/constants.js: one for EVENT_STATUS (with a NON_RECEIVED property) and
one for EVENT_PROGRESS (with a COMPLETE property). Then import these constants
at the top of the event-form.js file and replace the hardcoded strings in the
isDraftComplete() method with references to EVENT_STATUS.NON_RECEIVED and
EVENT_PROGRESS.COMPLETE respectively.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16b79371-9d2c-439a-a90b-f09256738f7f

📥 Commits

Reviewing files that changed from the base of the PR and between 23217a9 and ddf5d7d.

📒 Files selected for processing (1)
  • src/components/forms/event-form.js

Comment on lines +750 to +753
isDraftComplete() {
const { entity } = this.state;
return entity?.status === "NonReceived" && entity?.progress === "COMPLETE";
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify event progress constant usage

# Search for event progress constant definitions
rg -n --type=js -C3 'progress.*=.*["\']COMPLETE["\']' 

# Search for progress field usage in event context
rg -n --type=js -A3 -B3 'entity\.progress|event\.progress' src/pages/events/

# Check if there's an event-specific progress constant
ast-grep --pattern 'export const $EVENT_PROGRESS = {
  $$$
}'

Repository: fntechgit/summit-admin

Length of output: 135


🏁 Script executed:

#!/bin/bash
# Search for COMPLETE constant definitions
rg -n "COMPLETE" src/utils/constants.js src/utils/

# Search for NonReceived constant or usage
rg -n "NonReceived" --type=js -B2 -A2

# Check where progress field is set in event form
rg -n "progress" src/components/forms/event-form.js -B1 -A1 | head -50

# Look for event progress related constants
rg -n "progress|COMPLETE" src/utils/constants.js

Repository: fntechgit/summit-admin

Length of output: 1149


🏁 Script executed:

#!/bin/bash
# Check imports at top of event-form.js
head -50 src/components/forms/event-form.js | grep -n "import"

# Get full context of COMPLETE constant definition
rg -n -B5 -A5 "COMPLETE: \"COMPLETE\"" src/utils/constants.js

# Search for NonReceived constant definition
rg -n "NonReceived" src/utils/constants.js

# Check what COMPLETE constant belongs to (which export)
rg -n -B20 "COMPLETE: \"COMPLETE\"" src/utils/constants.js | head -40

Repository: fntechgit/summit-admin

Length of output: 2947


🏁 Script executed:

#!/bin/bash
# Search for all COMPLETE definitions across the codebase
rg -n "COMPLETE.*:" src/utils/constants.js

# Check for any event progress related constants
rg -n "PROGRESS|EVENT" src/utils/constants.js | head -20

# Search for where entity.progress is assigned or used
rg -n "\.progress\s*=" src/components/forms/event-form.js

# Check if COMPLETE is imported anywhere in event-form.js
rg -n "COMPLETE" src/components/forms/event-form.js

Repository: fntechgit/summit-admin

Length of output: 519


Define constants for event progress and status values rather than using string literals.

The isDraftComplete() method uses string literals "NonReceived" and "COMPLETE" directly. While the COMPLETE constant exists in src/utils/constants.js, it's defined for SPONSOR_MEDIA_UPLOAD_STATUS (line 304), not event progress. Similarly, NonReceived has no corresponding constant definition.

The code appears to use "COMPLETE" as a generic progress value, but this lacks proper constant definitions. Consider creating dedicated constants for event progress (e.g., EVENT_PROGRESS) and event status values (e.g., EVENT_STATUS) in src/utils/constants.js to improve maintainability and prevent typos.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/forms/event-form.js` around lines 750 - 753, The
isDraftComplete() method uses hardcoded string literals "NonReceived" and
"COMPLETE" instead of constants, which can lead to typos and maintenance issues.
Create two new constant definitions in src/utils/constants.js: one for
EVENT_STATUS (with a NON_RECEIVED property) and one for EVENT_PROGRESS (with a
COMPLETE property). Then import these constants at the top of the event-form.js
file and replace the hardcoded strings in the isDraftComplete() method with
references to EVENT_STATUS.NON_RECEIVED and EVENT_PROGRESS.COMPLETE
respectively.

@romanetar romanetar requested a review from smarcet June 18, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant